﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CoursePack
{
    [Serializable]
    public class Prerequisite
    {

        List<CourseDescription> m_Courses;

        public Prerequisite()
        {
            this.m_Courses = new List<CourseDescription>();
        }

        public bool IsPrerequisteCompleted(List<CourseDescription> _Course)
        {
            foreach (CourseDescription cc in _Course)
            {
                if (this.m_Courses.Find(o => (o.CourseName + o.CourseNumber == cc.CourseName + cc.CourseNumber)) != null)
                    return true;
            }
            return false;
        }

        public void AddCourse(CourseDescription _Course)
        {
            this.m_Courses.Add(_Course);
        }
    }
}
